//
//  LCHomeEssayImagesTableViewCell.m
//  JKFuYinProject
//
//  Created by admin on 2017/12/25.
//  Copyright © 2017年 LC. All rights reserved.
//

#import "LCHomeEssayImagesTableViewCell.h"
@interface LCHomeEssayImagesTableViewCell ()

@end

@implementation LCHomeEssayImagesTableViewCell


- (void)awakeFromNib {
    [super awakeFromNib];
    [self setupUI];
}
-(void)setupUI{
    CGFloat space = 10;

    [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.contentView).offset(15);
        make.left.equalTo(self.contentView).offset(space);
        make.right.equalTo(self.contentView).offset(-space);
        make.height.equalTo(self.titleLabel.mas_height);
    }];
    CGFloat spaceImages = 3;
    for (NSInteger i = 0; i < self.imgsrcImageViews.count; i++) {
        // 循环取出里面的UIImageView
        UIImageView *imgView = self.imgsrcImageViews[i];
        //布局
        CGFloat scale = 0.74/**9/16*/;
        [imgView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.titleLabel.mas_bottom).offset(13.5);
            make.width.equalTo(@((ScreenWidth - spaceImages*2-space*2)/3));
            make.height.equalTo(@((ScreenWidth - spaceImages*2-space*2)/3*scale));
            if (i == 0) {
                make.left.equalTo(self.contentView).offset(space);
            }else{
                UIImageView *lastImgView = self.imgsrcImageViews[i-1];
                make.left.equalTo(lastImgView.mas_right).offset(spaceImages);
            }
        }];
        if (i == 0) {
            [self.adddateLabel mas_makeConstraints:^(MASConstraintMaker *make) {
                make.top.equalTo(imgView.mas_bottom).offset(10);
                make.left.equalTo(self.contentView).offset(space);
                make.right.equalTo(self.contentView).offset(-space);
                make.height.equalTo(self.adddateLabel.mas_height);
            }];
        }
    }

}


@end
